<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSettingLoansTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('setting_loans', function (Blueprint $table) {
            $table->increments('id');
            $table->integer("blacklist_time")->unsigned()->default(3)->comment("关进小黑屋的时间,以月为单位");
            $table->string('loan_range',127)->default(json_encode([1000,50000]))->comment("借款的范围,json存储");
            $table->string("period_range")->default(json_encode([1,3,6]))->comment("借款的期限范围");
//            $table->integer("verify_time")->unsigned()->default(30*60)->comment("审核的时间,以秒为单位");
            // 收款的时候有一个3天的时间限制,再此期间可以收款
            $table->integer("receipt_time_one")->unsigned()->default(3*24*60*60)->comment("收款的有效期1");
            //但是当3天收款期限过的话,有一个收款超时->重新借款的状态,当没有超过收款有效期2,就可以重新收款,这时候就不用重复全部的步骤,只需要其中的几步就可以了
            $table->integer("receipt_time_two")->unsigned()->default(7*24*60*60)->comment("收款的有效期2");
//            $table->integer("fund_transfer_time")->unsigned()->default(24*60*60)->comment("款项的到账时间");
            $table->timestamps();
            $table->charset = 'utf8';
            $table->collation = 'utf8_general_ci';
            $table->comment = "借款、收款的相关配置信息";

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('setting_loans');
    }
}
